
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Diagnose functions &#8212; Bearing Vibration Diagnostics Toolbox 1.0 documentation</title>
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Linear algebra" href="linalg.html" />
    <link rel="prev" title="Plotting funtions" href="plt.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="linalg.html" title="Linear algebra"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="plt.html" title="Plotting funtions"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Bearing Vibration Diagnostics Toolbox 1.0 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-pyvib.diagnose">
<span id="diagnose-functions"></span><h1>Diagnose functions<a class="headerlink" href="#module-pyvib.diagnose" title="Permalink to this headline">¶</a></h1>
<p>diagnose</p>
<dl class="function">
<dt id="pyvib.diagnose.ES_SVD">
<code class="descclassname">pyvib.diagnose.</code><code class="descname">ES_SVD</code><span class="sig-paren">(</span><em>U</em>, <em>sigma</em>, <em>V</em>, <em>time</em>, <em>f_fault</em>, <em>f_side</em>, <em>PMItreshold</em>, <em>estimate_xi_func=&lt;function get_SVDxi&gt;</em>, <em>estimate_xi_func_params=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyvib.diagnose.ES_SVD" title="Permalink to this definition">¶</a></dt>
<dd><p>Envelope Score - SVD
Get PMI and weights for each fault frequency in f_fault
Based on envelope FFT score</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>U</strong> (<em>array 2D float</em>) – </li>
<li><strong>sigma</strong> (<em>array 1D float</em>) – The singular values</li>
<li><strong>V</strong> (<em>array 2D float</em>) – </li>
<li><strong>time</strong> (<em>array 1D float</em>) – The time of the signal before SVD is computed</li>
<li><strong>f_fault</strong> (<em>list</em><em> or </em><em>array_like</em>) – Frequency of each fault type</li>
<li><strong>f_side</strong> (<em>list</em><em> or </em><em>array_like</em>) – Side-band frequency for each fault type.
Use 0.0 for entries without side-bands</li>
<li><strong>PMIthreshold</strong> (<em>float</em><em>, </em><em>optional</em>) – The treshold for which a PMI becomes a weight</li>
<li><strong>estimate_xi_func</strong> (<em>function</em><em>, </em><em>optional</em>) – Which function to use to estimate the X_i before env.
Deafult is based on an SVD in the time/angular domain.
Must have (U, sigma, V, i) as input, and return x_i</li>
<li><strong>estimate_xi_func_params</strong> (<em>list</em><em> or </em><em>None</em><em>, </em><em>optional</em>) – List of extra variables to use as input
None for no extra input</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><ul class="simple">
<li><strong>PMI</strong> (<em>list of 1D array</em>) – PMI for each fault period</li>
<li><strong>W</strong> (<em>list of 1D array</em>) – Wights for each fault period</li>
</ul>
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="pyvib.diagnose.R_SVD">
<code class="descclassname">pyvib.diagnose.</code><code class="descname">R_SVD</code><span class="sig-paren">(</span><em>U</em>, <em>sigma</em>, <em>V</em>, <em>time</em>, <em>f_fault</em>, <em>tolerance=0.02</em>, <em>PMItreshold=1.0</em>, <em>estimate_xi_func=&lt;function get_SVDxi&gt;</em>, <em>estimate_xi_func_params=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pyvib.diagnose.R_SVD" title="Permalink to this definition">¶</a></dt>
<dd><p>Get PMI and weights for each fault frequency in f_fault
Based on the R-SVD algorithm in paper:
“A novel strategy for signal denoising using reweighted SVD and
its applications to weak fault feature enhancement of rotating
machinery”</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>U</strong> (<em>array 2D float</em>) – </li>
<li><strong>sigma</strong> (<em>array 1D float</em>) – The singular values</li>
<li><strong>V</strong> (<em>array 2D float</em>) – </li>
<li><strong>time</strong> (<em>array 1D float</em>) – The time of the signal before SVD is computed</li>
<li><strong>f_fault</strong> (<em>list</em><em> or </em><em>array_like</em>) – Frequency of each fault type</li>
<li><strong>tolerance</strong> (<em>float</em><em>, </em><em>optional</em>) – Tolerance around f_fault that the peak is searched for.</li>
<li><strong>PMIthreshold</strong> (<em>float</em><em>, </em><em>optional</em>) – The treshold for which a PMI becomes a weight</li>
<li><strong>estimate_xi_func</strong> (<em>function</em><em>, </em><em>optional</em>) – Which function to use to estimate the X_i before autocorr and env.
Deafult is based on an SVD in the time/angular domain.
Must have (U, sigma, V, i) as input, and return x_i</li>
<li><strong>estimate_xi_func_params</strong> (<em>list</em><em> or </em><em>None</em><em>, </em><em>optional</em>) – List of extra variables to use as input
None for no extra input</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><ul class="simple">
<li><strong>PMI</strong> (<em>list of 1D array</em>) – PMI for each fault period</li>
<li><strong>W</strong> (<em>list of 1D array</em>) – Wights for each fault period</li>
</ul>
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="pyvib.diagnose.diagnosefft">
<code class="descclassname">pyvib.diagnose.</code><code class="descname">diagnosefft</code><span class="sig-paren">(</span><em>Y</em>, <em>df</em>, <em>charf</em>, <em>X</em>, <em>subband</em>, <em>debug=False</em>, <em>version=2</em>, <em>harmthreshold=3.0</em>, <em>subthreshold=3.0</em><span class="sig-paren">)</span><a class="headerlink" href="#pyvib.diagnose.diagnosefft" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div>Diagnose a spectrum for bearing faults. Returns a score</div></blockquote>
<dl class="docutils">
<dt>Y <span class="classifier-delimiter">:</span> <span class="classifier">float 1D array</span></dt>
<dd>Spectrum values</dd>
<dt>df <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Delta frequency in Hz</dd>
<dt>charf <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Harmonic frequency</dd>
<dt>X <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Shaft speed in Hz</dd>
<dt>xubband <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Sideband frequency</dd>
<dt>debug <span class="classifier-delimiter">:</span> <span class="classifier">boolean, optional</span></dt>
<dd>Whether debug information is returned</dd>
<dt>version <span class="classifier-delimiter">:</span> <span class="classifier">int, optional</span></dt>
<dd><p class="first">Which version of this script to run. Default 2 with new noise estimator</p>
<p class="last">score : float
Score for fault being present</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="pyvib.diagnose.diagnosevibrationfft">
<code class="descclassname">pyvib.diagnose.</code><code class="descname">diagnosevibrationfft</code><span class="sig-paren">(</span><em>Y</em>, <em>df</em>, <em>X</em>, <em>bearing</em>, <em>radial=True</em><span class="sig-paren">)</span><a class="headerlink" href="#pyvib.diagnose.diagnosevibrationfft" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div>Diagnose a spectrum for all three fault types</div></blockquote>
<dl class="docutils">
<dt>Y <span class="classifier-delimiter">:</span> <span class="classifier">float 1D array</span></dt>
<dd>Spectrum amplitude</dd>
<dt>df <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Delta frequency in Hz</dd>
<dt>X <span class="classifier-delimiter">:</span> <span class="classifier">float</span></dt>
<dd>Shaft speed in Hz</dd>
<dt>bearing <span class="classifier-delimiter">:</span> <span class="classifier">array_like of floats</span></dt>
<dd>Bearing characteristic orders (inner,roller,cage,outer)</dd>
<dt>radial <span class="classifier-delimiter">:</span> <span class="classifier">boolean, optional</span></dt>
<dd>Whether radial forces exists. If so, sidebands exists</dd>
<dt>scores <span class="classifier-delimiter">:</span> <span class="classifier">float 1D array</span></dt>
<dd>Score for [inner,roller,outer]</dd>
</dl>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="plt.html"
                        title="previous chapter">Plotting funtions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="linalg.html"
                        title="next chapter">Linear algebra</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/diagnose.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="linalg.html" title="Linear algebra"
             >next</a> |</li>
        <li class="right" >
          <a href="plt.html" title="Plotting funtions"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Bearing Vibration Diagnostics Toolbox 1.0 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2019, Andreas Klausen.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
    </div>
  </body>
</html>